# 定义一个空元组
# tuple = ()

# 定义只有一个元素的元组
tuple_list = (10,)

# 测试开始
tuple_list1 = ('123', 5, 999, 'lisi')

# 元组的取值和取索引
print(tuple_list1[1])
print(tuple_list1.index(5))

# 元组的统计
print(tuple_list1.count(5))
print(len(tuple_list1))

# 格式化字符串
tuple_list2 = ('下水道', 1302, 7.5)
print("住在%s的%d室,房费%.1f元" % tuple_list2)

# 列表和元组转换
list_num = [1, 2, 3]
print(type(list_num))
list_to_tup = tuple(list_num)
print(type(list_to_tup))

tup_to_list = list(list_to_tup)
print(type(tup_to_list))
